#[macro_export]
macro_rules! c_str {
    ($s:expr) => {{
        concat!($s, "\0").as_ptr() as *const ::std::os::raw::c_char
    }};
}

#[macro_export]
macro_rules! funs {
    ($($fname:ident($($args:expr),*)),*) => {
        Box::new([
            $($crate::php::function::Function::new_with_args(
                $crate::c_str!(stringify!($fname)),
                $fname,
                Box::new([
                    $($crate::php::function::ArgInfo::new($crate::c_str!($args),0,0,0),)*
                ])
            ),)*
            $crate::php::function::Function::end()
        ])
    }
}

#[macro_export]
macro_rules! str_index {
    ($s:expr) => {
        $crate::ArrayIndex::NtStr(concat!($s, "\0"))
    };
}

#[macro_export]
macro_rules! gc_flags {
    ($p: expr) => {
        (*$p).gc.u.v.flags
    };
}

#[macro_export]
macro_rules! z_type_info {
    ($zval: expr) => {
        $zval.u1.type_info
    };
}
